﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ApprovalFlow.Models
{
    public class ExecutionPointer
    {
        /// <summary>
        /// id
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 审批实例的唯一码。
        /// </summary>
        public string InstanceId { get; set; }

        /// <summary>
        /// 步骤id
        /// </summary>
        public int StepID { get; set; }

        /// <summary>
        /// 步骤名称
        /// </summary>
        public string StepName { get; set; }

        /// <summary>
        /// 代理执行类型
        /// </summary>
        public string Processor { get; set; }

        /// <summary>
        /// 是否激活该步骤
        /// </summary>
        public bool Active { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? EndTime { get; set; }

        public bool EventPublished { get; set; }

        /// <summary>
        /// 前置ID。
        /// </summary>
        public string PredecessorId { get; set; }

        /// <summary>
        /// 持久化数据(用来存储运行过程中的持久化数据)
        /// </summary>
        public object PersistenceData { get; set; }

        /// <summary>
        /// 扩展属性(用来存储设计过程中的节点配置)
        /// </summary>
        public Dictionary<string, object> ExtensionAttributes { get; set; } = new Dictionary<string, object>();

        /// <summary>
        /// 事件数据
        /// </summary>
        public object EventData { get; set; }

        /// <summary>
        /// 状态(0,未开始；1,审批中；2,同意；3,拒绝)
        /// </summary>
        public PointerStatus Status { get; set; }

        public override string ToString()
        {
            return this.StepName;
        }
    }
}
